<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增客户发票')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: select2-css" />
    <th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-invoice-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">银行账单id：</label>
                <div class="col-sm-8">
                    <input name="billId" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">开票时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="invoiceDate" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">客户id：</label>
                <div class="col-sm-8">
<!--                    <label class="font-noraml">客户id：</label>-->
                    <select class="form-control" name="customerId" th:with="customer=${@CustomerMsgService.selectYtCustomerMsgList(null) }">
                        <option th:each="c : ${customer}" th:text="${c.name}" th:value="${c.customerId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">发票代码：</label>
                <div class="col-sm-8">
                    <input name="invoiceCode" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">发票号码：</label>
                <div class="col-sm-8">
                    <input name="invoiceNumber" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">工程名称：</label>
                <div class="col-sm-8">
                    <input name="projectName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">工程地点：</label>
                <div class="col-sm-8">
                    <input name="projectSite" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">税率：</label>
                <div class="col-sm-8">
                    <select name="taxRate" class="form-control m-b" th:with="type=${@dict.getType('sys_tax')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">开票金额：</label>
                <div class="col-sm-8">
                    <input name="invoiceAmount" class="form-control" type="text" required>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: select2-js" />
    <th:block th:include="include :: bootstrap-select-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/invoice"
        $("#form-invoice-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-invoice-add').serialize());
            }
        }

        $("input[name='invoiceDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>